/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package org.sbbs.admin.cfg;

import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * @author jenkins
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 声明MessageSourceAccessor作为i18n消息获取入口
     *
     * 另外 jsf页面中获取消息的入口sms,底层使用的joinfaces定义的MessageSourceBridge:
     *
     * @Bean("sms") public MessageSourceBridge messageSourceBridge(MessageSource
     * messageSource) { return new MessageSourceBridge(messageSource); }
     * @param messageSource
     * @return
     */
    @Bean("sma")
    public MessageSourceAccessor messageSourceAccessor(MessageSource messageSource) {
        return new MessageSourceAccessor(messageSource);
    }
}
